package com.wande.dataplatform.filecollection.domain.bo;

import com.wande.common.core.validate.AddGroup;
import com.wande.common.core.validate.EditGroup;
import com.wande.common.mybatis.core.domain.BaseEntity;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 文件采集规则业务对象
 *
 * @author wande
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class CollectionRuleBo extends BaseEntity {

    /**
     * 主键ID
     */
    @NotNull(message = "主键ID不能为空", groups = {EditGroup.class})
    private Long id;

    /**
     * 规则名称
     */
    @NotBlank(message = "规则名称不能为空", groups = {AddGroup.class, EditGroup.class})
    private String ruleName;

    /**
     * 规则编码
     */
    @NotBlank(message = "规则编码不能为空", groups = {AddGroup.class, EditGroup.class})
    private String ruleCode;

    /**
     * 文件类型(CSV/XLS/XLSX/XML/JSON/SQL)
     */
    @NotBlank(message = "文件类型不能为空", groups = {AddGroup.class, EditGroup.class})
    private String fileType;

    /**
     * 来源类型(LOCAL/FTP/SFTP/HTTP/OSS)
     */
    @NotBlank(message = "来源类型不能为空", groups = {AddGroup.class, EditGroup.class})
    private String sourceType;

    /**
     * 来源配置(JSON格式)
     */
    private String sourceConfig;

    /**
     * 调度类型(REALTIME/HOURLY/DAILY/WEEKLY/MONTHLY/MANUAL)
     */
    @NotBlank(message = "调度类型不能为空", groups = {AddGroup.class, EditGroup.class})
    private String scheduleType;

    /**
     * 调度配置(Cron表达式)
     */
    private String scheduleConfig;

    /**
     * 目标数据库
     */
    @NotBlank(message = "目标数据库不能为空", groups = {AddGroup.class, EditGroup.class})
    private String targetDatabase;

    /**
     * 目标表
     */
    @NotBlank(message = "目标表不能为空", groups = {AddGroup.class, EditGroup.class})
    private String targetTable;

    /**
     * 入库策略(OVERWRITE/APPEND/UPSERT)
     */
    @NotBlank(message = "入库策略不能为空", groups = {AddGroup.class, EditGroup.class})
    private String loadStrategy;

    /**
     * 状态(ENABLED/DISABLED)
     */
    private String status;

    /**
     * 映射规则ID
     */
    private Long mappingRuleId;

    /**
     * DolphinScheduler任务ID
     */
    private Long dsTaskId;
}
